<template>
  <div>
    <p>{{ $t("lang.account") }}: zhangsan</p>
    <p>{{ $t("lang.password") }}: 123456</p>

    <button @click="handClick">切换语言</button>
  </div>
</template>

<script>
export default {
  methods: {
    handClick() {
      if (this.$i18n.locale === "en") {
        this.$i18n.locale = "zh";
      } else {
        this.$i18n.locale = "en";
      }
    },
  },
};
</script> 

